﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ZeroSumNashSolver
{
    class Program
    {
        static void Main(string[] args)
        {
            if (!Directory.Exists("in")) Directory.CreateDirectory("in");
            if (!Directory.Exists("out")) Directory.CreateDirectory("out");

            foreach (string filepath in Directory.EnumerateFiles("in"))
            {
                string filename = filepath.Split('\\').ToArray()[1];

                Console.Write("Beginning " + filename);

                double[,] inputmat = Matrix.ReadFromFile("in\\" + filename);
                SimplexResult result = Matrix.Simplex(inputmat);

                Console.Write("\n");

                result.Print(filename);

                Console.WriteLine("Completed " + filename);
            }
        }
    }
}